
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <style>
        p {
            font-size: 12px;
        }
    </style>
</head>

<body>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt, veritatis.</p>
<div class="item"></div>
<script src="../vendor/jquery-1.12.4.js"></script>
<script>
    $(function() {

        var element = $('p');

                //每点击一下此元素，字体就会变大一点
        element.click(function () {
                    $(this).css('fontSize', '+=5')
                }).data('data', 'demo');

        element.remove()  //remove方法,移除元素后,把事件和数据都删除掉了
        //console.log(element.data());

        //element.detach();  //detach方法,移除元素后,事件和数据都在

        console.log(element.data());

        //element.appendTo($('.item'))
        //
        //

        //element.empty();  //清除元素内容，保留元素本身
    });
</script>
</body>

</html>